package linc.spring.demo;

import linc.spring.demo.config.AppConfig;
import linc.spring.demo.service.UserService;
import linc.spring.framework.MyApplicationContext;

/**
 * @author yqlin
 * @date 2021/9/3 22:58
 * @description
 */
public class Main {

    public static void main(String[] args) {
        // 类-->无参构造(推断构造)
        // ->对象
        // -->依赖注入(属性填充)
        // --->Aware回调接口
        // BeanPostProcessor - ->postProcessBeforeInitialization
        // --->初始化前(@PostConstruct)-
        // ->初始化(InitializingBean)
        // -->BeanPostProcessor postProcessAfterInitialization
        // -->初始化后BeanPostProcessor(Aop-->代理对象)
        // ----> Bean
        MyApplicationContext applicationContext = new MyApplicationContext(AppConfig.class);
        UserService userService = (UserService) applicationContext.getBean("userService");
        userService.test();
    }
}
